Things You Need to Know About TypeScript

date
Aug 14, 2019
status
Published
tags
Typescript
summary
type
Post
This passage is not finished and is still in progress…
  1. Numbers:
what this compiles to javascript is
In typescript, using underscore makes your code easier to read.
2. Add “!” to tell ts to ignore it
3. keyof
“+” clearly indicates that we are adding a “readonly” modifier and the “-” clearly indicates that we are deleting “optional” modifier.
4. types and interface
They are similar to some extent
Another example:
Differences:
interface can merge but types cannot merge
5. unknown or any
6. conditional types

© ming 2021 - 2025